Skip to content

fix: order remote browser close events#3099

Open
rohan-patnaik wants to merge 2 commits into
microsoft:mainfrom
rohan-patnaik:fix-remote-connect-close-ordering
Open

fix: order remote browser close events#3099
rohan-patnaik wants to merge 2 commits into
microsoft:mainfrom
rohan-patnaik:fix-remote-connect-close-ordering

Conversation

@rohan-patnaik

Copy link
Copy Markdown
Contributor

Summary

  • Backport the remote browser close ordering fix from microsoft/playwright@d8d5289.
  • Close pages and contexts first, clean up the remote connection, then emit browser disconnected on the next event-loop turn.
  • Add async regression tests for pending wait_for_event rejection before browser.close() returns and before disconnected fires.

Closes #3097

Tests

  • python -m py_compile playwright\_impl\_browser_type.py tests\async\test_browsertype_connect.py

Full browser tests were not run locally because this checkout does not contain the generated Playwright driver payload.

@Skn0tt

Skn0tt commented Jun 10, 2026

Copy link
Copy Markdown
Member

Looks like tests are red.

@Skn0tt Skn0tt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like tests are red.

@rohan-patnaik

Copy link
Copy Markdown
Contributor Author

Let me check and come back

@rohan-patnaik

rohan-patnaik commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up fix after checking the Windows CI timeouts.
The wait_for_event test was hanging because waiter telemetry tried to send waitForEventInfo while the remote pipe was already closing; the update CI should rerun on the new commit.

@rohan-patnaik rohan-patnaik requested a review from Skn0tt June 10, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Remote browser close should reject pending waiters before disconnect events

2 participants